﻿@using Controllers
@{
    var func=new MyFunc();
}
<!DOCTYPE html>
<html>
<head>
@Html.Partial("_top")
</head>
<body>
@Html.Partial("_header")
<div class="mainbg">
	<div class="w1200 mt20 cl">
		<div class="w260 fl">		
@Html.Partial("_left")
		</div>
		<div class="w900 fr">
			<div class="newt_1 rel"><span class="abs fs16 fb">@ViewBag.model.title</span><h1>当前位置：@Html.Raw(ViewBag.model.cur)</h1></div>
			<ul class="newl_3 mt15">
			@{    var page = Request.QueryString["page"];
							int p = 1;
							int pagesize=ViewBag.model.info["model"].pnum;
							if (!string.IsNullOrEmpty(page))
							{
								p = Convert.ToInt32(page);
							}
							var pagelist=func.GetPageList(p,pagesize,ViewBag.model.ID);}
						@for (int i = 0; i < pagelist.Items.Count; i++)
						{
						var item=pagelist.Items[i];						
					var url=string.IsNullOrEmpty(item.url)?"/article/"+item.ID:item.url;
					var target=string.IsNullOrEmpty(item.url)?"_self":"_blank";
					
      
        <li><a href="@url" title="@item.title" target="@target">@item.title</a><span>@item.addtime.ToString("yyyy-MM-dd")</span></li>
					
					}
			</ul>
			
			<div class="page">
			<ul class="pagination">
					<li><a href="/list/@ViewBag.model.ID">首页</a></li>
					@for (int i = 0; i < pagelist.TotalPages; i++)
					{
						<li><a href="@Url.Action("List","Home",new {page=i+1})" @if(i==pagelist.CurrentPage){@Html.Raw("class=\"active\"");}>@(i+1)</a></li>
					}
				<li><a href="/list/@ViewBag.model.ID?page=@pagelist.TotalPages">尾页</a></li>
				<li><a>第 @pagelist.CurrentPage /@pagelist.TotalPages 页</a></li>
				<li><a>共 @pagelist.TotalItems 条</a></li>
			</ul>
			</div>
		</div>
	</div>
</div>

<div id="footer">
	@Html.Raw(ViewBag.model.copyright)
</div>

<script type="text/javascript">
$(function () {
    $(".nav ul li a[href='/list/@ViewBag.model.ID']").addClass("current");
    $(".nav ul li a[href='/list/@ViewBag.model.classid']").addClass("current");
	
    var tag=$(".nav_1 li a[href='/list/@ViewBag.model.ID']").closest("li");

	tag.addClass("current");
})
</script>
</body>
</html>
